Use the Static method Dns.GetHostAddresses to get a list of computer IP Addresses. First, you need to to get the Computer name. Then pass it as a parameter to the Dns.GetHostAddresses method.
Required Namespace:
System.Net
C#
String ComputerName= Dns.GetHostName(); IPAddresses[] localIPs = Dns.GetHostAddresses(ComputerName);
Comments